#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <syslog.h>
#include <signal.h>
#include <unistd.h>
#include "sockConn.h"
#include <sstream>

using namespace std;
using namespace mayi;
int main( int argc, char * argv[] )
{
	sockConn *s = new sockConn("localhost", 10105, 0, 0);
	s->Connect();
	char buf[1025];
	sprintf(buf,"hello,world");
	unsigned wsize = 0;
	unsigned wbytes = 0;
	char *rbuf = (char *)malloc(11);

	for(int j=0; j<4; j++)
		if(s->getStatus())
		{
			s->Proxy((const char *)buf, 11, &rbuf, wsize, wbytes);
			cout<<"receive = "<< rbuf<< "; wsize = "<< wsize <<endl;

		}

	free(rbuf);
	delete s;
	return 0;
}
